/***************************************************************************
 *            tetris.h
 *
 *  Sa Januar 21 13:02:25 2012
 *  Copyright  2012  ich
 *  <user@host>
 ****************************************************************************/
/*
 * tetris.h
 *
 * Copyright (C) 2012 - ich
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef TETRIS_H_INCLUDED
#define TETRIS_H_INCLUDED



/**
 * Elementare Daentypen für das eigendliche Tetrisspiel
 */

enum {TYPE1=1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, SPEZIAL_1, SPEZIAL_2, SPEZIAL_3};


typedef struct TFN_Feld_s {
	unsigned short int feld[20][35];
} TFN_Feld_t, *TFN_Feld_p;

typedef struct TFN_Block_s {
	unsigned char x, y;
	unsigned short int type;
} TFN_Block_t, *TFN_Block_p;

typedef struct TFN_Stein_s {
	TFN_Block_t block[4];
	unsigned int drehung;
	int type;
} TFN_Stein_t, *TFN_Stein_p;



typedef struct TFN_Contex_s {
	TFN_Feld_p spfeld;
	TFN_Stein_p spstein;
	TFN_Stein_p nextstein;
	void *zeit;
	unsigned int level;
	unsigned int punkte;
} TFN_Contex_t, *TFN_Contex_p;


int TFN_InitTetris (TFN_Contex_p contex);
int TFN_NeuerStein (TFN_Contex_p contex);//TODO
int TFN_MVStein (int x, int y, TFN_Contex_p contex);//TODO
int TFN_DreheStein (TFN_Contex_p contex);//TODO
int TFN_Pruefekollision (TFN_Stein_p stein, TFN_Feld_p feld);//TODO
int TFN_PruefeZeile (TFN_Contex_p contex);//TODO
int TFN_RMZeile (int zeile, TFN_Contex_p contex);//TODO
int TFN_PruefeEnde (TFN_Contex_p contex);
int TFN_BlitStein (TFN_Contex_p contex);//TODO






#endif // TETRIS_H_INCLUDED